package com.xcf.service.business.common.riverboat.impl;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcf.dao.DaoSupport;
import com.xcf.entity.Page;
import com.xcf.entity.system.User;
import com.xcf.service.business.common.riverboat.*;
import com.xcf.util.PageData;


/** 绯荤粺鐢ㄦ埛
 * @author Micro Chen
 * 淇敼鏃堕棿锛�2017.11.07
 */
@Service("riverBoatService")
@SuppressWarnings("all")
public class RiverBoatService implements RiverBoatManager{

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	
	
	
	
	/**閫氳繃USERNAEME鑾峰彇鏁版嵁
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public PageData findByRiverBoatName(PageData pd)throws Exception{
		return (PageData)dao.findForObject("RiverBoatMapper.findByRiverBoatName", pd);
	}
	
	
	
	/**鐢ㄦ埛鍒楄〃
	 * @param page
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> listRiverBoats(Page page)throws Exception{
		List<PageData> list =  (List<PageData>) dao.findForList("RiverBoatMapper.riverboatlistPage", page);
		return list;
	}
	
	
	/**淇濆瓨鐢ㄦ埛
	 * @param pd
	 * @throws Exception
	 */
	public void saveRiverBoat(PageData pd)throws Exception{
		dao.save("RiverBoatMapper.saveRiverBoat", pd);
	}
	 	

	
	/**鐢ㄦ埛鍒楄〃(鍏ㄩ儴)
	 * @param USER_IDS
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> listAllUser(PageData pd)throws Exception{
		return (List<PageData>) dao.findForList("RiverBoatMapper.listAllUser", pd);
	}
	
	/**鑾峰彇鎬绘暟
	 * @param pd
	 * @throws Exception
	 */
	public PageData getUserCount(String value)throws Exception{
		return (PageData)dao.findForObject("RiverBoatMapper.getUserCount", value);
	}
	public void updateRiverBoatInfo(PageData pd)throws Exception{
		dao.update("RiverBoatMapper.updateRiverBoat", pd);
	}



	@Override
	public void deleteRiverBoatInfo(PageData pd) throws Exception {
		dao.delete("RiverBoatMapper.deleteInfo", pd);
		
	}

	@Override
	public List<Map> search(PageData pd) throws Exception {
		List<Map> list = (List<Map>) dao.findForList("RiverBoatMapper.search",pd);
		return list;
	}
}
